// inputNumber只能输入数字
Vue.directive('inputNumber', {
    bind(el, binding, vnode) {
        function eventHandler() {
            const { value } = el;
            el.value = value.replace(/[^\d]/g, '');
            vnode.componentInstance.$emit('input', el.value);
        }
        el.addEventListener('input', eventHandler);
    },
});